package com.day11.study.annotation_demo;

@DataBaseConfig
public class DBUtil {
    public DBUtil() {
        boolean isExist = DBUtil.class.isAnnotationPresent(DataBaseConfig.class);
        System.out.println(isExist);
        if (isExist) {
            DataBaseConfig dba = (DataBaseConfig) DBUtil.class.getAnnotation(DataBaseConfig.class);
            System.out.println(dba.url());
            System.out.println(dba.username());
            System.out.println(dba.password());
        }
    }

    public static void main(String[] args) {
        new DBUtil();
    }
}
